﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace TestApp
{
	public class Commands
	{
		public static RoutedUICommand RunQuery = new RoutedUICommand ( "RunQuery", "RunQuery", typeof ( Commands ),
			new InputGestureCollection ( new InputGesture[] { new KeyGesture ( Key.F5, ModifierKeys.None, "Run Query" ) } ) );

		private QueryManager _manager;

		public Commands (QueryManager manager, Window1 window)
		{
			_manager = manager;

			window.CommandBindings.Add ( new CommandBinding ( RunQuery, RunQueryHandler ) );
		}

		private void RunQueryHandler ( object sender, ExecutedRoutedEventArgs args )
		{
			_manager.Run ();
		}
	}
}
